﻿@model IList<FCDB.Entity.ReportFieldSettings>
@{
    ViewBag.Title = "FeildSetting";
    Layout = "~/Views/Shared/_POContentLayout.cshtml";
} 
@section HeadIncluder
{
    <link rel="stylesheet" type="text/css" href=@Url.Content("~/Scripts/skins/default.css") />  
}
<form id="GetForm" name="GetForm" method="get" action="@Url.Action("FeildSetting", "BusinessReport")">
    <div>
        <table class="tb-search mb10" style="width: 100%;">
            <tr>
                <td class="box " style="width: 75%;">
                    &nbsp; <input type="button" id="btnAdd" onclick="add()" value="添加" class="btn btn-blue " />
                    &nbsp; <input type="submit" id="submit" value="刷新" class="btn btn-blue " />

                </td>
            </tr>
        </table>
    </div>
    <div>
        <table class="table-list mt20">
            <thead>
                <tr>
                    <th>编号</th>
                    <th>名称</th>
                    <th>创建时间</th>
                    <th>是否为默认</th>
                    <th>操作</th>
                </tr>
                </thead>
            <tbody>
@if (Model != null)
{
    foreach (var item in Model)
    {
        <tr>
            <td>@item.ID</td>
            <td>@item.Name</td>
            <td>@item.CreateTime.Value.ToString("yyyy年MM月dd日")</td>
            <td>@(item.IsDefault==true?"是":"否")</td> 
            <td>
                <a onclick="edit('@item.ID')" href="javascript:void(0)">编辑</a>|
                <a onclick="del('@item.ID')" href="javascript:void(0)">删除</a> 
                
            </td>
        </tr>
    }
}
 </tbody>
</table>
    </div>
    <script type="text/javascript" src='@Url.Content("~/Scripts/lhgdialog.min.js")'> </script>  
    <script type="text/javascript">
        function onRefresh()
        {
            window.location.reload();
        }
        function OpenPop(url, titleName, width, height) {
            width = width || 370;
            height = height || 300;
            window.top.winObj = window;
            window.top.refresh = onRefresh;
            window.top.oDG = $.dialog({
                lock: true,
                background: '#FFF',
                opacity: 0.5,
                id: 'esDialog',
                title: titleName,
                titleAlign: 'left',
                content: "url:" + url,
                width: width,
                height: height,
                btnBar: false,
                lockScroll: true
            });
        }
        function add()
        {
            var url = '@Url.Action("UserFieldSetting", "BusinessReport")';
            OpenPop(url, "业务字段明细设置", 800, 580);
        }
        function edit(id) {
            var url = '@Url.Action("UserFieldSetting", "BusinessReport")'+'?id='+id;
            OpenPop(url, "业务字段设置", 800, 580);
        }
        function del(id)
        {
            $.dialog.confirm('你确定要删除吗？', function () {
                $.post('@Url.Action("DeleteFeildSetting", "BusinessReport")', {id:id}, function (data) {
                    onRefresh();
                });
            }); 
        }
    </script>
</form>